#pragma once
#include "orders.h"

struct OrderQueryOptionS{
    unsigned int offset_;
    unsigned int size_;
    //TODO: add other page request options
};

struct OrderQueryDataS {
    char resultMsg_[128];
    long long totalCnt_;
    long long currentCnt_;
    OrderS dataCollection_[0];
};

extern "C" OrderQueryOptionS *orderQueryCreateOption(const unsigned int offset, const unsigned int size);
extern "C" void orderQueryDestroyOption(OrderQueryOptionS *option);
extern "C" void orderQueryOptionSetOffset(const unsigned int offset, OrderQueryOptionS *option);
extern "C" void orderQueryOptionSetSize(const unsigned int size, OrderQueryOptionS *option);
//only for test
extern "C" unsigned int orderQueryOptionGetOffset(OrderQueryOptionS *option);
extern "C" unsigned int orderQueryOptionGetSize(OrderQueryOptionS *option);

extern "C" OrderQueryDataS *orderQueryCreateData(const int cnt);
extern "C" void orderQueryDestroyData(OrderQueryDataS *data);
extern "C" char *orderQuerygetResultMsg(OrderQueryDataS *data);
extern "C" long long orderQuerygetTotalCnt(OrderQueryDataS *data);
extern "C" long long orderQuerygetCurrentCnt(OrderQueryDataS *data);
extern "C" OrderS *orderQuerygetDataCollection(OrderQueryDataS *data);

extern "C" int orderQuery(const OrderQueryOptionS *option, OrderQueryDataS *result);
